
import java.io.Serializable;

public class User implements Serializable {

    private int x,  y;
    private int way;
    private int anim;
    private int anim2;
    private int speed;
    private boolean walk;
    private int size;
    private int id;
    private boolean dead;
    
    public User() {
        
    }

    public User(int id, int x, int y, int speed, int size) {
        this.id = id;
        this.x = x;
        this.y = y;
        this.size = size;
        way = 0;
        anim = 0;
        this.speed = speed;
        anim2 = 0;
        dead = false;
    }

    public int id() {
        return id;
    }

    public int x() {
        return x;
    }

    public int y() {
        return y;
    }

    public boolean dead() {
        return dead;
    }

    public void dead(boolean b) {
        dead = b;
    }

    public int size() {
        return size;
    }

    public void size(int i) {
        size = i;
    }

    public int way() {
        return way;
    }

    public void pos(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public void left() {
        x -= speed;
    }

    public void up() {
        y -= speed;
    }

    public void right() {
        x += speed;
    }

    public void down() {
        y += speed;
    }

    public int anim() {
        return anim;
    }

    public void anim(int anim) {
        this.anim = anim;
    }

    public void way(int way) {
        this.way = way;
    }

    public void walk(boolean b) {
        walk = b;
    }

    public boolean walk() {
        return walk;
    }

    public int speed() {
        return speed;
    }

    public void animate() {
        anim2++;
        if (anim2 == 5) {
            anim2 = 0;
            anim++;
            if (anim > 3) {
                anim = 0;
            }
        }
    }
}
